import QtQuick 2.2
import "../images"

Rectangle {
    id: close
    property bool isSelect: false
    signal onClose()
    width: 30; height: 16
  //  visible: false
    function changepic()
    {
        if(isSelect)
        {
            closepic.source = "../images/close1.png"
           // isSelect = false
        }
        else
        {
            closepic.source = "../images/close0.png";
           // isSelect = true
        }
    }

    MouseArea{
        anchors.fill: parent
        onPressed:
        {
            isSelect = true;
            parent.changepic()
        }

        onReleased:
        {
            isSelect = false
            parent.changepic()
        }
        onClicked:
        {
            console.log(qsTr("send \"close\" message to Header  -----------Close"))
            onClose()
        }
    }

    Image {
        id: closepic
        source: "../images/close0.png"
    }

}
